<template>
  <div class="infos">
    <div class="name">
      {{ topInfos?.houseName }}
    </div>
    <div class="tags">
      <template v-for="(item, index) in topInfos?.houseTags" :key="index">
        <span
          :style="{ color: item.tagText.color, background: item.tagText.background.color }"
          class="item"
          v-if="item.tagText"
          >{{ item.tagText.text }}</span
        >
      </template>
    </div>
    <div class="comment common">
      <div class="left">
        <span class="score" style="font-size: 20px; font-weight: 700">{{
          topInfos?.commentBrief.overall
        }}</span>
        <span class="title" style="margin: 0px 5px">{{ topInfos?.commentBrief.scoreTitle }}</span>
        <span class="brief" style="color: grey">"{{ topInfos?.commentBrief.commentBrief }}"</span>
      </div>
      <div class="right">
        <span class="count">{{ topInfos?.commentBrief.totalCount }}条评论</span>
        <van-icon name="arrow"></van-icon>
      </div>
    </div>
    <div class="location common">
      <div class="left" style="font-weight: 700">
        {{ topInfos?.nearByPosition.address }}
      </div>
      <div class="right">
        <span>地图·周边</span>

        <van-icon name="arrow"></van-icon>
      </div>
    </div>
  </div>
</template>

<script setup>
defineProps({
  topInfos: {
    type: Object,
    default: () => {},
  },
})
</script>

<style lang="scss" scoped>
.infos {
  padding: 15px;
  .name {
    font-size: 20px;
    font-weight: 700;
  }
  .tags {
    margin: 5px 0;

    .item {
      margin-right: 5px;
    }
  }

  .common {
    display: flex;
    justify-content: space-between;
    background-color: #f5f5f5;
    padding: 10px;
    margin: 5px 0px;
    border-radius: 10px;
  }
  .right {
    color: var(--primary-color);
  }
}
</style>
